package org.glow.changgou.goods.feign;

import org.glow.changgou.entity.Result;
import org.glow.changgou.goods.pojo.Sku;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author Glow
 * @Date 2022-09-28 12:02:58
 * @Description
 * @Version 1.0
 */
@FeignClient(name="goods")
@RequestMapping(value = "/sku")
public interface SkuFeign {

    /***
     * 根据审核状态查询Sku
     * @param status
     * @return
     */
    @GetMapping("/status/{status}")
    Result<List<Sku>> findByStatus(@PathVariable String status);
    @PostMapping("/search")
    Result<List<Sku>> findList(@RequestBody(required = false)  Sku sku);
    @GetMapping("/{id}")
    public Result<Sku> findById(@PathVariable(value = "id", required = true) Long id);
    @PostMapping(value = "/decr/count")
    public Result decrCount(@RequestParam(value = "username")String username);
}